<template>
  <div class="main">
    <div class="index-wrap">
      <div class="index-left">
      <!-- 轮播图 -->
        <MainNav/>
      </div>
      <MainSwiper />
    </div>
    <!-- 搜索框 -->
    <div class="search">
      <div>
        <el-input
          class="search-input"
          placeholder="请输入职位/公司/内容关键词"
          v-model="querystring"
          clearable
          @keyup.enter.native="search()"
        ></el-input>
        <el-button class="search-btn" type="primary"   @click="search()">搜索</el-button>
      </div>
      <div class="rs">
        <span>热搜:
          <a @click="kf" href="javascript:void(0)">开发</a>
          <a @click="fwy" href="javascript:void(0)">服务员</a>
          <a @click="xs" href="javascript:void(0)">销售</a>
          <a @click="java" href="javascript:void(0)">java</a>
          <a @click="hd" href="javascript:void(0)">后端</a></span
        >
      </div>
    </div>
    <div class="hotwork">
      <span>热门岗位</span>
    </div>
    <div>
      <HotWork/>
    </div>
    <div class="hotwork">
      <span>热门企业</span>
    </div>
    <div>
      <HotCompany/>
    </div>
  </div>
</template>

<script>
import MainNav from './mainNav'
import MainSwiper from './mainswiper.vue'
import HotWork from '../main/hotwork'
import HotCompany from '../main/hotcompany'
export default {
  name: 'main',
  components: { 
    MainNav,
    MainSwiper ,
    HotWork,
    HotCompany
    },
  data() {
    return {
      querystring: '',
    }
  },
  methods:{
    async search(){
      window.sessionStorage.setItem("search",this.querystring)
      this.$router.push("/userRecruit")
    },
    async kf(){
      window.sessionStorage.setItem("search","开发")
      this.$router.push("/userRecruit")
    },
    async fwy(){
      window.sessionStorage.setItem("search","服务员")
      this.$router.push("/userRecruit")
    },
    async xs(){
      window.sessionStorage.setItem("search","销售")
      this.$router.push("/userRecruit")
    },
    async java(){
      window.sessionStorage.setItem("search","java")
      this.$router.push("/userRecruit")
    },
    async hd(){
      window.sessionStorage.setItem("search","后端")
      this.$router.push("/userRecruit")
    },
  }
}
</script>

<style lang="less" scoped>

.main {
  background-color: #FAF9F9;
}
.swiper {
  background-color: #fff;
  padding-left: 10px;
  padding-right: 10px;
}
.search {
  margin: 0 auto;
  padding-left: 12%;
  margin-top: 10px;
  height: 100px;
  background-color: #fff;
  padding-top: 20px;
}
.search-input {
  line-height: 70px;
  height: 40px;
  width: 70%;
  font-size: 20px;
  align-items: center;
  margin-left: 20px;
  border-color: #c0c4cc;
}
.search-btn {
  margin-left: 10px;
  width: 10%;
  height: 40px;
  text-align: center;
  font-size: 20px;
}
.rs {
  width: 100%;
  height: 50px;
  background-color: #fff;
  margin-top: 10px;
  span {
    padding-left: 35px;
    font-size: 16px;
    color: #c0c4cc;
    a {
      color: #c0c4cc;
      margin-left: 16px;
      text-decoration: none;
    }
    a:hover {
      color: orangered;
    }
  }
}
.index-left{
  float: left;
  width: 300px;
  text-align: left;
  margin-right: 20px;
  height: 445px;
  background: #fff;
  box-shadow: 4px 2px 5px #888888;
  border:1px solid #cecccc;
}
.index-wrap{
  width: 80%;
  height: 450px;
  margin: 0 auto;
  overflow: hidden;
  margin-top: 00px;
}
.hotwork{
  width: 100%;
  height: 100px;
  margin-top: 10px;
  background-color: #fff;
  line-height: 100px;
  span{
    margin-left: 10%;
    font-size: 25px;
    color: black;
  }
}

</style>
